libxl: fix devd removal path
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 23 Sep 2015 10:06:55 +0000 (12:06 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Sep 2015 10:42:50 +0000 (11:42 +0100)
commit5c9a00c57172182652c432e80cc278bebc044dc4
tree21afcd37bdd7f66e318ab1047afc8d8c279ab010
parent3f214fea76acc6cbc1101fe1815cee795483a67d
libxl: fix devd removal path

The current flow of the devd helper (in charge of launching hotplug scripts
inside of driver domains) is to wait for the device backend to switch to
state 6  (XenbusStateClosed) and then remove it. This is not correct, since
a domain can reconnect it's PV devices as many times as it wants.

In order to fix this, introduce the following logic: the control domain will
set the "online" backend node to 0 when it wants the driver domain to
disconnect the device, so now the condition applied in devd is that "state"
must be 6 and "online" 0 in order to proceed with the disconnection.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
Cc: Alex Velazquez <alex.j.velazquez@gmail.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_device.c